#include("/WEB-INF/admin/common/header.html")
<ul id="demo"></ul>
<div class="dataUrlIframe">
	<iframe src="#(BASE_PATH)/admin/manageCenter/msg/alarmmsg"></iframe>
</div>
	  
<script>

	
layui.use(["jquery",'element','tree'], function(){
  var element = layui.element; //导航的hover效果、二级菜单等功能，需要依赖element模块
  var 	$=layui.jquery;
  var layuitree = layui.tree;
  
  	  element.on('nav(demo)', function(data){
  	    console.log(data);
  	  });
  	  
  		$('.dataUrlHeader a').on('click', function() {						 	 
  		    var url =$(this).attr('data-url');
   	   $(".dataUrlIframe iframe").attr('src',url);  		    
		  }); 
  		
  		layui.tree({
  		  elem: '#demo' //传入元素选择器
  		  ,nodes: [{ //节点
  		    name: '父节点1'
  		    ,children: [{
  		      name: '子节点11',
  		      url:'#(BASE_PATH)/swagger'
  		    },{
  		      name: '子节点12',
  		   	 url:'#(BASE_PATH)/security/user'
  		    }]
  		  },{
  		    name: '父节点2（可以点左侧箭头，也可以双击标题）'
  		    ,children: [{
  		      name: '子节点21'
  		      ,children: [{
  		        name: '子节点211'
  		      }]
  		    }]
  		  }]
  		,click: function(node){
  		    console.log(node) //node即为当前点击的节点数据
  		  $(".dataUrlIframe iframe").attr('src',node.url);  	
  	    }  
  		});
  		
});
</script>
</html>

